package view.items;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Insets;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import model.Call;
import controller.Controller;
import controller.ControllerLighter;

public class PanelPendingCall extends PanelAbstract {
	public PanelPendingCall(Call call, Controller controller, ControllerLighter controllerLighter) {
		super(call, controllerLighter);
		JLabel jlabel = new JLabel(call.getFirstName());
		jlabel.setPreferredSize(new Dimension(70,20));
		jlabel.setForeground(this.colorLabel);
		
		JLabel jlabel2 = new JLabel(call.getLastName());
		jlabel2.setPreferredSize(new Dimension(52,20));
		jlabel2.setForeground(this.colorLabel);
		
		JLabel jlabel3 = new JLabel(call.getIp().toString().replace("/", ""));
		jlabel3.setPreferredSize(new Dimension(95,20));
		jlabel3.setForeground(this.colorLabel);
		

		
		
		
		ImageIcon iconResume = new ImageIcon(getClass().getResource("/img/lecture.png"));
		JButton buttonResume = new JButton(iconResume);
		buttonResume.setFont(new Font("Arial",Font.ITALIC,10));
		buttonResume.setMargin(new Insets(0, 0, 0, 0));
		buttonResume.setPreferredSize(new Dimension(23,23));
		buttonResume.setActionCommand("buttonResume");
		buttonResume.addActionListener(controller);
		buttonResume.setContentAreaFilled(false);
		buttonResume.setBorderPainted(false);
		buttonResume.setToolTipText("Click to resume Call");
		
		ImageIcon iconEnd = new ImageIcon(getClass().getResource("/img/rouge.png"));
		JButton buttonEnd = new JButton(iconEnd);
		buttonEnd.setFont(new Font("Arial",Font.ITALIC,10));
		buttonEnd.setMargin(new Insets(0, 0, 0, 0));
		buttonEnd.setPreferredSize(new Dimension(23,23));
		buttonEnd.setActionCommand("buttonEnd");
		buttonEnd.addActionListener(controller);
		buttonEnd.setContentAreaFilled(false);
		buttonEnd.setBorderPainted(false);
		buttonEnd.setToolTipText("Click to end Call");
		
		this.add(jlabel2);
		this.add(jlabel);
		this.add(jlabel3);
		this.add(buttonResume);
		this.add(buttonEnd);
	}
}
